1. Field of the Invention
The present invention relates generally to generating work for a graphics processing unit (GPU) and, more specifically, to GPU work creation and stateless graphics in OpenGL.
2. Description of the Related Art
In a typical processing environment, and especially in a graphics processing environment, there is a large amount of state information that is transmitted by an application to facilitate the processing of input data in a processing pipeline. The state information is transmitted by the application executing on a central processing unit (CPU) to an external processing unit, such as a graphics processing unit (GPU), via a driver.
Existing graphics application program interfaces (APIs) have an extremely limited capacity for creating work from within the GPU. Some APIs provide a “draw indirect” functionality, where the parameters to a DrawElements or DrawArrays call (primitive type, vertex count, and indices used to address data in a vertex buffer) are taken from a buffer in GPU memory rather than being specified on the CPU. This allows those parameters to be written by the GPU, and then consumed by the GPU without being read back to the CPU. However, such a mechanism still requires that the application code running on the CPU know ahead of time that the work is going to be generated, where the corresponding parameters need to be written, and in what order various work must be executed. In addition, the CPU thread is responsible for setting up the state required to process each GPU-generated draw command as well as submitting the work. Therefore, such a mechanism does not alleviate the dependency on the CPU to create workloads or portions thereof that are to be processed on the GPU.
As the foregoing illustrates, what is needed in the art is a mechanism for effectively generating graphics workloads that are to be processed by the GPU from within the GPU.